/**
 * 
 */
package de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.tests;

import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.datacreation.feature_types.CaseFeatures;

/**
 * @author Christoph Teichmann
 * created Jun 7, 2014 4:51:01 PM
 * @version 0.1
 */
public class TestCaseFeatures
{
	/**
	 * 
	 */
	private CaseFeatures cf;
	/**
	 *
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception
	{this.cf = new CaseFeatures();}
	/**
	 * Test method for {@link de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.datacreation.feature_types.CaseFeatures#process(java.lang.String)}.
	 */
	@Test
	public final void testProcess()
	{
		assertEquals(cf.process("Hans"),"hans");
		assertEquals(cf.process("hans"),"hans");
		assertEquals(cf.process("hANs"),"hans");
	}
	/**
	 * Test method for {@link de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.datacreation.feature_types.CaseFeatures#name()}.
	 */
	@Test
	public final void testName()
	{assertEquals(cf.name(),"CASEFEATURE");}
	/**
	 * Test method for {@link de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.datacreation.feature_types.GenericFeatureGenerator#getFeatName(java.lang.String)}.
	 */
	@Test
	public final void testGetFeatName()
	{
		assertEquals(cf.getFeatName("HAans"),"INITIALUPPERCASE");
		assertEquals(cf.getFeatName("hans"),"LOWERCASE");
		assertEquals(cf.getFeatName("hANs"),"MIXED");
		assertEquals(cf.getFeatName("haNS"),"ENDINGUPPERCASE");
		assertEquals(cf.getFeatName("HANS"),"ALLUPPERCASE");
	}
	/**
	 * Test method for {@link de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.datacreation.feature_types.GenericFeatureGenerator#updateWeight(java.lang.String, boolean, double)}.
	 */
	@Test
	public final void testUpdateWeight()
	{
		assertEquals(cf.updateWeight("hans", true, 20.0),1.0,0.000001);
		assertEquals(cf.updateWeight("hans", false, 20.0),21.0,0.000001);
		assertEquals(cf.updateWeight("hans", false, 0.0),1.0,0.000001);
	}
	/**
	 * Test method for {@link de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.datacreation.feature_types.GenericFeatureGenerator#getFeatureOptions()}.
	 */
	@Test
	public final void testGetFeatureOptions()
	{assertEquals(cf.getFeatureOptions().toString(),"[LOWERCASE, INITIALUPPERCASE, MIXED, ENDINGUPPERCASE, ALLUPPERCASE]");}
	/**
	 * Test method for {@link de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.datacreation.feature_types.GenericFeatureGenerator#getType()}.
	 */
	@Test
	public final void testGetType()
	{assertEquals(cf.getType(),"multinomial");}
}